-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support defining records by dns zone format #1360
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1360 +/- ##
==========================================
+ Coverage 93.96% 93.97% +0.01%
==========================================
Files 78 78
Lines 6343 6361 +18
==========================================
+ Hits 5960 5978 +18
Misses 294 294
Partials 89 89 ☔ View full report in Codecov by Sentry. |
My thoughts on the open questions:
I opt for removal since it's not released yet.
There is a struct in helpertest to generate temporary folders and subsequently string based files for testing. If you look for the usages it should be obvious how to use it in tests. 😉
It should be enough to list what is currently not/supported and a link to an proper zonefile documentation (documenting it ourselves is a bit out of scope). 🤔
customDNS.customTTL should only apply to the old format (documentation should mention it) in my opinion. |
docs/configuration.md
Outdated
@@ -264,6 +264,7 @@ domain must be separated by a comma. | |||
| customTTL | duration (no unit is minutes) | no | 1h | | |||
| rewrite | string: string (domain: domain) | no | | | |||
| mapping | string: string (hostname: address or CNAME) | no | | | |||
| zoneFileMapping | multiline string containing a DNS Zone File | no | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it supports already more than the simple mapping and is no file by itself I would opt for zone
as config key. 🤔
Perfect! Thank you for your input @kwitsch. I'll implement these changes as I have some free time in the next day or 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this!
I agree with everything @kwitsch said above :)
Just have very minor comments.
config/custom_dns.go
Outdated
return err | ||
} | ||
|
||
result := make(ZoneFileDNS, len(input)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor copy-paste typo (1
seems sensible since you're probably at least going to have a domain if you specify the option):
result := make(ZoneFileDNS, len(input)) | |
result := make(ZoneFileDNS, 1) |
config/custom_dns_test.go
Outdated
@@ -67,7 +69,7 @@ var _ = Describe("CustomDNSConfig", func() { | |||
}) | |||
}) | |||
|
|||
Describe("UnmarshalYAML", func() { | |||
Describe("#CustomDNSEntries UnmarshalYAML", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does #
do anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! I will remove it when I work on this next
This should be ready for another round of reviews 😄 |
Gonna look into it tomorrow. 🙂👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff, except the $INCLUDE
thing which is a bit bigger but hopefully has enough guidance to follow!
…as relative filenames when using the $INCLUDE directive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two details, besides that everything looks good to me!
…se when config param passed to blocky is a directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again, this is great!
@kwitsch I didn't merge in case you had somethign to add. Anything left? If not can you press the green button? :) |
✅ |
Closes #1355
As I got to looking at the issue above, it became obvious to me that support for DNS zone files only requires a very small change to my previous PR.
Outstanding questions for others:
CNAME()
method undermappings
? This hasn't been published as far as I can tell, so we have the option to remove it before it hits the mainline if we don't like/want that syntax moving forward for non-A records.$INCLUDE
directive?$GENERATE
directive and expect others to use it?